 # 登录定位器
from selenium.webdriver.common.by import By
from page.base_page_helin import BasePage

class LoginPage(BasePage):
    url = "http://192.168.1.55/crm"
    username_locator = (By.NAME,'name')
    password_locator = (By.NAME, 'password')
    submit_locator = (By.NAME,"submit")

    def add_username(self,username):
        self.driver.find_element(*self.username_locator).send_keys(username)

    def add_password(self,password):
        self.driver.find_element(*self.password_locator).send_keys(password)

    def click_submit(self):
        self.driver.find_element(*self.submit_locator).click()

    def open(self):
        self.driver.get(self.url)
